#ifndef QDAILYTIMER_H
#define QDAILYTIMER_H

#include <QTimer>
#include <QtDebug>
#include <QDateTime>

class QDailyTimer : public QTimer
{
    Q_OBJECT
private:
    int _hours, _minutes, _seconds;
    bool _timeout_on_weekends;
    QDateTime* _nextschedule;
    QTimer* _internaltimer;

private:
    void initTimer();
    bool isNowTheTime();
    void setInterval(int msec);
    void assignTimeValues(int h, int m);

private slots:
    virtual void internalTimer_timedout();

public:
    QDailyTimer(int h, int m=0);
    QDateTime* nextSchedule();
    bool getTimeoutOnWeekends();
    void setTimeoutOnWeekends(bool flag);
    void reschedule(int h, int m=0);

public slots:
    void start();
    void stop();
};

#endif // QDAILYTIMER_H
